mergNotify
Type
command
Summary
This command registers for a notification to be sent to the calling control (me) whenever it occurs
Syntax
mergNotify <pNotification>, [<pDistributed>]
Description
The same notification may be registered by multiple controls in your app. If a single control registers for the same notification multiple times it will receive it multiple times.
Parameters
Name | Type | Description |
---|---|---|
pNotification | The name of the notification your control should receive. The notification will be sent to the control with a single pUserInfo parameter. This parameter is the result of using the description method of the NSNotification userInfo dictionary. Some notifications do not have any userInfo so this parameter may be empty. | |
pDistributed | (optional with false default) On OS X this option allows you to use the distributed notification center to recieve notifications from other applications. The parameter has no effect on iOS. |
Examples
local sTimeResignedActive
constant kMaxTimeResignedBeforeSessionExpires = 300
on openStack
mergNotify "UIApplicationWillResignActiveNotification"
mergNotify "UIApplicationDidBecomeActiveNotification"
end openStack
on UIApplicationWillResignActiveNotification pUserInfo
put the seconds into sTimeResignedActive
end UIApplicationWillResignActiveNotification
on UIApplicationDidBecomeActiveNotification pUserInfo
if sTimeResignedActive <> "" then
if the seconds - sTimeResignedActive > kMaxTimeResignedBeforeSessionExpires then
-- show session expired so login again UI
end if
end if
end UIApplicationDidBecomeActiveNotification
Compatibility and Support
Introduced
LiveCode 8.0
OS
ios
mac
Platforms
desktop
mobile